<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang='en'>
  <head>
    <title>Module</title>
    <meta content='text/html; charset=UTF-8' http-equiv='Content-Type'>
    <link href='../css/style.css' media='screen' rel='stylesheet' type='text/css'>
    <script type='text/javascript'>
      //<![CDATA[
        function popupCode(url) {
          window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
        }
        
        function toggleCode(id) {
          var code = document.getElementById(id)
        
          code.style.display = code.style.display != 'block' ? 'block' : 'none'
          return true
        }
        
        // Make codeblocks hidden by default
        document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
      //]]>
    </script>
  </head>
  <body class='page'>
    <div class='class' id='wrapper'>
      <div class='header'>
        <h1 class='name'>
          <span class='type'>class</span>
          Module
        </h1>
        <ol class='paths'>
          <li>
            <a target="docwin" href="../files/lib/krpc/core_extensions_rb.html">lib/krpc/core_extensions.rb</a>
          </li>
        </ol>
        <div class='parent'>
          Superclass:
          <strong><a target="docwin" href="Object.html">Object</a></strong>
        </div>
      </div>
      <div id='content'>
        <div id='text'>
          <div id='description'></div>
          <div id='method-list'>
            <h2>Methods</h2>
            <h3>Public Instance</h3>
            <ol>
              <li><a target="docwin" href="#method-i-class_name">class_name</a></li>
              <li><a target="docwin" href="#method-i-const_get_or_create">const_get_or_create</a></li>
            </ol>
          </div>
          <div id='context'>
          </div>
          <div id='section'>
            <div id='methods'>
              <h2>Public Instance methods</h2>
              <div class='method public-instance' id='method-method-i-class_name'>
                <a name='method-i-class_name'></a>
                <div class='synopsis'>
                  <span class='name'>class_name</span>
                  <span class='arguments'>()</span>
                </div>
                <div class='description'>
                  
                </div>
                <div class='source'>
                  <a class='source-toggle' href='#' onclick="toggleCode('method-i-class_name-source'); return false">
                    [show source]
                  </a>
                  <pre id='method-i-class_name-source'><span class="ruby-comment"># File lib/krpc/core_extensions.rb, line 3</span>&#x000A;<span class="ruby-keyword">def</span> <span class="ruby-identifier">class_name</span>&#x000A;  <span class="ruby-identifier">name</span>.<span class="ruby-identifier">rpartition</span>(<span class="ruby-string">&quot;::&quot;</span>).<span class="ruby-identifier">last</span>&#x000A;<span class="ruby-keyword">end</span></pre>
                </div>
              </div>
              <div class='method public-instance' id='method-method-i-const_get_or_create'>
                <a name='method-i-const_get_or_create'></a>
                <div class='synopsis'>
                  <span class='name'>const_get_or_create</span>
                  <span class='arguments'>(module_name, value = nil, &block)</span>
                </div>
                <div class='description'>
                  
                </div>
                <div class='source'>
                  <a class='source-toggle' href='#' onclick="toggleCode('method-i-const_get_or_create-source'); return false">
                    [show source]
                  </a>
                  <pre id='method-i-const_get_or_create-source'><span class="ruby-comment"># File lib/krpc/core_extensions.rb, line 7</span>&#x000A;<span class="ruby-keyword">def</span> <span class="ruby-identifier">const_get_or_create</span>(<span class="ruby-identifier">module_name</span>, <span class="ruby-identifier">value</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)&#x000A;  <span class="ruby-keyword">return</span> <span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">module_name</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">const_defined?</span>(<span class="ruby-identifier">module_name</span>, <span class="ruby-keyword">false</span>)&#x000A;  <span class="ruby-identifier">value</span> = <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">block_given?</span>&#x000A;  <span class="ruby-identifier">const_set</span>(<span class="ruby-identifier">module_name</span>, <span class="ruby-identifier">value</span>)&#x000A;  <span class="ruby-identifier">value</span>&#x000A;<span class="ruby-keyword">end</span></pre>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div id='footer-push'></div>
    </div>
    <div id='footer'>
      <a target="docwin" href="http://github.com/mislav/hanna/tree/master"><strong>Hanna</strong> RDoc template</a>
    </div>
  </body>
</html>
